/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.jfonia.actions;

import javax.swing.AbstractAction;
import javax.swing.Icon;
import org.jfonia.connect5.basics.Observer;
import org.jfonia.view.main.LeadSheetPlayer;

/**
 *
 * @author Rik Bauwens
 */
public abstract class PlayerAction extends AbstractAction implements Observer
{
        protected PlayerAction(String name, Icon icon)
        {
                super(name, icon);
                LeadSheetPlayer.getInstance().addStateObserver(this);
                setEnabled(LeadSheetPlayer.getInstance().isReady());
        }

        public void onNotify(Object source)
        {
                setEnabled(LeadSheetPlayer.getInstance().isReady());
        }
}
